/*
 * Copyright 2010-2012 Susanta Tewari. <freecode4susant@users.sourceforge.net>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/*
* StringUtil.java
*
* Created on December 14, 2007, 8:20 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
 */
package javautil.lang;

/**
 *
 * @author stewari1
 */
public class StringUtil {

    public static void main(String[] args) {}

    public static String capFirstLetter(String word) {

        char[] charSeq = word.toCharArray();

        charSeq[0] = Character.toUpperCase(charSeq[0]);

        return new String(charSeq);
    }

    public static String getPadding(int charCount) {

        String pad = "";

        for (int i = 0; i < charCount; i++) {

            pad += " ";
        }

        return pad;
    }

    public static String[][] setWithEmptyStr(String[][] str2DArray, String setStr) {

        for (int i = 0; i < str2DArray.length; i++) {

            for (int j = 0; j < str2DArray[i].length; j++) {

                str2DArray[i][j] = setStr;
            }
        }

        return str2DArray;
    }

    /**
     * gives roman letters for numbers from 1 to 7
     */
    public static String getRoman(int i) {

        String roman = "";

        switch (i) {

            case 1 :
                roman = "I";

                break;

            case 2 :
                roman = "II";

                break;

            case 3 :
                roman = "III";

                break;

            case 4 :
                roman = "IV";

                break;

            case 5 :
                roman = "V";

                break;

            case 6 :
                roman = "VI";

                break;

            case 7 :
                roman = "VII";

                break;

            default :
                roman = "Not Found";
        }

        return roman;
    }
}
